import java.util.Random;
import java.util.Scanner;
public class Test {
    /*public static void main(String[] args) {
        //根据 day 的值输出星期几
        Scanner scanner = new Scanner(System.in);
        int day = scanner.nextInt();
        switch(day){
            case 1:
                System.out.println("星期一");
                break;
            case 2:
                System.out.println("星期二");
                break;
            case 3:
                System.out.println("星期三");
                break;
            case 4:
                System.out.println("星期四");
                break;
            case 5:
                System.out.println("星期五");
                break;
            case 6:
                System.out.println("星期六");
                break;
            case 7:
                System.out.println("星期日");
                break;
            default:
                System.out.println("输入错误");
                break;
        }
    }*/


    /*public static void main(String[] args) {
        //打印 1 - 10 的数字
        int n = 1;
        //注意这里的结果一定要是布尔类型
        while(n <= 10){
            System.out.print(n+" ");
            n++;
        }
    }*/


    /*public static void main(String[] args) {
        //计算 1 - 100 的和
        int n = 1;
        int sum = 0;
        while(n <= 100){
            sum += n;
            n++;
        }
        System.out.println(sum);
    }*/


    /*public static void main(String[] args) {
        //计算 5 的阶乘
        int ret = 1;
        int n = 1;
        while(n <= 5){
            ret *= n;
            n++;
        }
        System.out.println(ret);
    }*/


    /*public static void main(String[] args) {
        //计算 1! + 2! + 3! + 4! + 5
        int sum = 0;
        int n = 1;
        int ret = 1;
        while(n <= 5){
            ret *= n;
            sum += ret;
            n++;
        }
        System.out.println(sum);
    }*/


    /*public static void main(String[] args) {
        //找到 100 - 200 中第一个是 3 的倍数的数字
        int n = 100;
        while(n <= 200){
            if(n % 3 == 0){
                System.out.println(n);
                break;
            }
            n++;
        }
    }*/


    /*public static void main(String[] args) {
        //找到 100 - 200 中第一个是 3 的倍数的数字
        int n = 100;
        while(n <= 200){
            if(n % 3 != 0){
                n++;//这个不能少
                continue;
            }
            System.out.println(n);
            break;
        }
    }*/


    /*public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入你的名字：");
        String name = scanner.nextLine();
        System.out.print("请输入你的年龄：");
        int age =scanner.nextInt();
        System.out.println("你的信息如下：");
        System.out.println("名字"+name+"\n"+"年龄"+age);
    }*/


    /*public static void main(String[] args) {
        //使用 Scanner 循环读取 N 个数字，并求取其平均值
        Scanner scanner = new Scanner(System.in);
        int n = 0;
        double avg = 0;
        int sum  = 0;
        while(scanner.hasNextInt()){
            int j =  scanner.nextInt();
            sum += j;
            n++;
        }
        avg = sum*1.0 / n;
        System.out.println(avg);

    }*/


    //猜数字游戏
    /*public static void game() {
        Scanner scanner = new Scanner(System.in);
        Random random = new Random();
        int num= random .nextInt(100)+1;
        System.out.println(num);
        int i = 5;
        do{
            i--;
            System.out.print("请输入你要猜的数字：");
            int n = scanner.nextInt();
            if(n > num){
                System.out.print("猜大了，请重新猜！");
                System.out.println("你还剩"+i+"次机会！");
            } else if (n < num) {
                System.out.print("猜小了，请重新猜！");
                System.out.println("你还剩"+i+"次机会！");
            }else {
                System.out.println("恭喜你，猜对了");
                break;
            }
        }while(i != 0);

    }
    public static void menu() {
        System.out.println("***************************************");
        System.out.println("******         猜数字游戏          ******");
        System.out.println("******    1. play    0. exit     ******");
        System.out.println("***************************************");
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int input = 0;
        do{
            menu();
            System.out.print("请选择你要进行的操作：");
            input = scanner.nextInt();
            switch(input){
                case 1:
                    System.out.println("游戏开始，请做好准备！");
                    game();
                    break;
                case 0:
                    System.out.println("游戏退出");
                    break;
                default:
                    System.out.println("选择错误，请重新选择");
                    break;
            }
        }while(input != 0);
    }*/



}
